#include "widget_score_graph.h"
#include "players.h"
#include "gui.h"
#include <qwt_plot_curve.h>



score_graph_widget::score_graph_widget( std::vector< std::vector< double > >* data ): Plot( "Players taktics comparison", "Round number", "Score" )
{
	for ( unsigned int i = 0; i < data->size(); ++i )
	{
		QwtPlotCurve *players_score = new QwtPlotCurve( players::get_instance()->get_player( i )->get_name().c_str() );
		players_score->setRenderHint( QwtPlotItem::RenderAntialiased );
		players_score->setPen( QPen( *game_gui::get_instance()->graphics->get_QColor( i ) ) );
		players_score->attach( this );
		players_score->setData( GraphData( &( ( *data )[ i ] ) ) );
	};
};